#include <54func.h>
int main()
{
    if(fork())
    {
        printf("I am parent! pid = %d,pgid = %d,pgid of ppid = %d\n",
                getpid(),getpgid(0),getpgid(getppid()));
    }else{
        //将子进程的组号设置为自己的pid号
        setpgid(0,0);//把自己的组号（pgid）设置为自己的进程号（pid）
        printf("I am child! pid = %d,pgid = %d,pgid of ppid = %d\n",
                getpid(),getpgid(0),getpgid(getppid()));
        
    }
    return 0;
}
